<template>
	<view class="content">
		<image class="logo" src="/static/images/logo.png"></image>
		<view class="text-area">
			<text class="title">{{uniapp测试}}</text>
		</view>
		<view class="routeContent">
			<navigator url="/pages/ifCompiler/ifCompiler" hover-class="navigator-hover">
				<button size="mini" type="default">条件编译</button>
			</navigator>
			<navigator url="/pages/globalClass/globalClass" hover-class="navigator-hover">
				<button size="mini" type="default">全局样式及变量</button>
			</navigator>
			<navigator url="/pages/globalDataRouter/globalDataRouter?name=yaping&age=30" hover-class="navigator-hover">
				<button size="mini" type="default">全局数据及路由使用</button>
			</navigator>
			<navigator url="/pages/uniComponent/uniComponent" open-type="redirect" hover-class="other-navigator-hover">
				<button size="mini" type="default">常用组件</button>
			</navigator>
			<navigator url="/pages/uniComponent/uniComponent1" open-type="redirect" hover-class="other-navigator-hover">
				<button size="mini" type="default">常用组件1</button>
			</navigator>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello cc'
			}
		},
		onLoad() {
			// 页面实例
			console.log('indexInstance...',this)
			// 获取应用实例
			const appInstance = getApp();
			console.log('appInstance...',appInstance, appInstance.globalData)
			// app.testFn()
			// 函数用于获取当前页面栈的实例，以数组形式按栈的顺序给出，数组中的元素为页面实例，第一个元素为首页，最后一个元素为当前页面。
			const pages = getCurrentPages();
			const currentPageInstance = pages[pages.length-1];
			const currentPageRoute = currentPageInstance.route;
			console.log('page...',pages)
			console.log('currentPageInstance...', currentPageInstance)
			console.log('currentPageRoute...', currentPageRoute)
			// 获取当前页面的webview对象实例 app可用
			// #ifdef APP
			const currentWebview = currentPageInstance.$getAppWebview();
			// #endif
		},
		methods: {

		}
	}
</script>

<style lang="scss">
	/* 样式条件编译 */
	.ifdef{
		/* #ifdef WEB */
			color: red;
		/* #endif */
		
		/* #ifdef MP-WEIXIN */
			color: blue;
		/* #endif */
	}
	/* 页面样式默认开启scope */
	/* 页面样式自动覆盖全局样式 */
	@import '@/common/css/globalBase.scss';
	.uniGlobalImportScssVar{
		// border: $globalBorder;
		background-color: $globalBackGround;
	}
	.uniGlobalScssVar{
		font-size: $globalFS;
		color: $globalFC;
	}
	.globalImportScssVar{
		border: 1px solid $borderColor; 
	}
	.globalScssVar{
		// border: 1px solid $borderColorApp; 
	}
	.globalCssVar{
		border: 1px solid $borderColor;
		font-size: var(--fs);
		color: var(--fc);
	}
	.content {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		justify-content: center;
		padding: 10px;
		.routeContent{
			// display: flex;
		}
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 20rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 10rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
